package com.wxyzz.canteenadmin.order.orderDetails.controller;

import com.wxyzz.canteenadmin.order.orderDetails.service.OrderDetailsService;
import com.wxyzz.canteenadmin.order.orderDetails.vo.OrderDetailsVo;
import com.wxyzz.canteencommon.common.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/order/orderDetails")
public class OrderDetailsController {

    @Autowired
    private OrderDetailsService orderDetailsService;

    @GetMapping("/getOrderDetail")
    // 返回订单详细信息
    public R getOrderDetail(String orderNumber) {

        List<OrderDetailsVo> orderDetail = orderDetailsService.getOrderDetail(orderNumber);
        return R.ok(orderDetail);
    }
}
